package com.city.domain.city;

import javax.persistence.*;
import java.util.Objects;

/**
 * @deprecation: 乡镇基本信息表
 * @dmail: 398521613@qq.com
 * @author: L-H
 * @date: 2018-07-18 13:14
 */
@Entity
@Table(name = "city_town", schema = "city", catalog = "")
public class CityTown {
    private int townId;//主键
    private String townName;//乡镇名称
    private String leader;//领导
    private String leaderTel;//分管领导电话
    private String head;//扶贫主任
    private String headTel;//扶贫主任电话
    private byte villageCount;//行政村数
    private double area;//幅员面积
    private byte school;//学校数量
    private String schoolImg;//学校图片
    private byte hospital;//医院数量
    private String hospitalImg;//医院图片
    private byte serviceCenter;//是否有服务中心
    private String serviceCenterImg;//服务中心图片
    private int collector;//采集人
    private int collectTime;//采集时间
    private int updateTime;
    private String lng;//经度
    private String lat;//纬度

    @Id
    @Column(name = "town_id")
    public int getTownId() {
        return townId;
    }

    public void setTownId(int townId) {
        this.townId = townId;
    }

    @Basic
    @Column(name = "town_name")
    public String getTownName() {
        return townName;
    }

    public void setTownName(String townName) {
        this.townName = townName;
    }

    @Basic
    @Column(name = "leader")
    public String getLeader() {
        return leader;
    }

    public void setLeader(String leader) {
        this.leader = leader;
    }

    @Basic
    @Column(name = "leader_tel")
    public String getLeaderTel() {
        return leaderTel;
    }

    public void setLeaderTel(String leaderTel) {
        this.leaderTel = leaderTel;
    }

    @Basic
    @Column(name = "head")
    public String getHead() {
        return head;
    }

    public void setHead(String head) {
        this.head = head;
    }

    @Basic
    @Column(name = "head_tel")
    public String getHeadTel() {
        return headTel;
    }

    public void setHeadTel(String headTel) {
        this.headTel = headTel;
    }

    @Basic
    @Column(name = "village_count")
    public byte getVillageCount() {
        return villageCount;
    }

    public void setVillageCount(byte villageCount) {
        this.villageCount = villageCount;
    }

    @Basic
    @Column(name = "area")
    public double getArea() {
        return area;
    }

    public void setArea(double area) {
        this.area = area;
    }

    @Basic
    @Column(name = "school")
    public byte getSchool() {
        return school;
    }

    public void setSchool(byte school) {
        this.school = school;
    }

    @Basic
    @Column(name = "school_img")
    public String getSchoolImg() {
        return schoolImg;
    }

    public void setSchoolImg(String schoolImg) {
        this.schoolImg = schoolImg;
    }

    @Basic
    @Column(name = "hospital")
    public byte getHospital() {
        return hospital;
    }

    public void setHospital(byte hospital) {
        this.hospital = hospital;
    }

    @Basic
    @Column(name = "hospital_img")
    public String getHospitalImg() {
        return hospitalImg;
    }

    public void setHospitalImg(String hospitalImg) {
        this.hospitalImg = hospitalImg;
    }

    @Basic
    @Column(name = "service_center")
    public byte getServiceCenter() {
        return serviceCenter;
    }

    public void setServiceCenter(byte serviceCenter) {
        this.serviceCenter = serviceCenter;
    }

    @Basic
    @Column(name = "service_center_img")
    public String getServiceCenterImg() {
        return serviceCenterImg;
    }

    public void setServiceCenterImg(String serviceCenterImg) {
        this.serviceCenterImg = serviceCenterImg;
    }

    @Basic
    @Column(name = "collector")
    public int getCollector() {
        return collector;
    }

    public void setCollector(int collector) {
        this.collector = collector;
    }

    @Basic
    @Column(name = "collect_time")
    public int getCollectTime() {
        return collectTime;
    }

    public void setCollectTime(int collectTime) {
        this.collectTime = collectTime;
    }

    @Basic
    @Column(name = "update_time")
    public int getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(int updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "lng")
    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    @Basic
    @Column(name = "lat")
    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CityTown cityTown = (CityTown) o;
        return townId == cityTown.townId &&
                villageCount == cityTown.villageCount &&
                Double.compare(cityTown.area, area) == 0 &&
                school == cityTown.school &&
                hospital == cityTown.hospital &&
                serviceCenter == cityTown.serviceCenter &&
                collector == cityTown.collector &&
                collectTime == cityTown.collectTime &&
                updateTime == cityTown.updateTime &&
                Objects.equals(townName, cityTown.townName) &&
                Objects.equals(leader, cityTown.leader) &&
                Objects.equals(leaderTel, cityTown.leaderTel) &&
                Objects.equals(head, cityTown.head) &&
                Objects.equals(headTel, cityTown.headTel) &&
                Objects.equals(schoolImg, cityTown.schoolImg) &&
                Objects.equals(hospitalImg, cityTown.hospitalImg) &&
                Objects.equals(serviceCenterImg, cityTown.serviceCenterImg) &&
                Objects.equals(lng, cityTown.lng) &&
                Objects.equals(lat, cityTown.lat);
    }

    @Override
    public int hashCode() {

        return Objects.hash(townId, townName, leader, leaderTel, head, headTel, villageCount, area, school, schoolImg, hospital, hospitalImg, serviceCenter, serviceCenterImg, collector, collectTime, updateTime, lng, lat);
    }
}
